package com.cloudmusic.dao;

import com.cloudmusic.entity.User;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface UserMapper {
	
	void addUser(@Param("uid")String uid,@Param("username")String username,@Param("password")String password);

	void inserLikeToSongList(@Param("likelid")String likelid);

	void inserCollectionToSongList(@Param("collectionlid")String collectionlid);

	void inserLikeToUserSongList(@Param("uid")String uid,@Param("likelid")String likelid);

	void inserCollectionToUserSongList(@Param("uid")String uid,@Param("collectionlid")String collectionlid);

	User getUserById(Integer id);

	List<Map<String, Object>> getUserList();

	List<User> getUsersList(@Param("username")String username);

	String isExitUserName(@Param("signInUserName")String signInUserName);

	List<Map<String,Object>> findSongLists(@Param("userId")Object userId);

	//播放历史
	void insertHistoryList(@Param("uid")String uid,@Param("historylid")String historylid);

	void insertHistoryToUserSongList(@Param("uid")String uid,@Param("historylid")String historylid);

	String selectUserHistoryListId(@Param("uid")String uid);

	void addHistoryPlayMusic(@Param("historylid")String historylid,@Param("sid")String sid);

	void updateHistoryPlayMusic(@Param("historylid")String historylid,@Param("sid")String sid);

	void updateMusicPlayTimes(@Param("sid")String sid);

    int checkMusic(@Param("historylid")String historylid,@Param("sid")String sid);

    //初始化个人信息数据
	void insertUserInfo(@Param("uid")String uid,@Param("username")String username);

	void updateUserInfo(@Param("nname")String nname,@Param("sex")String sex ,@Param("phone")String phone ,@Param("email")String email,@Param("uid")String uid);

	List<Map<String,Object>> selectUserInfo(@Param("uid")String uid);

	//更改用户禁用状态（逻辑删除账号）
	void updateUserState(@Param("uid")String uid);

	//注销账号（物理删除账号，包括歌单、账号、个人信息等一同删除）
	void deleteUserSongList(@Param("uid")String uid);

	void deleteUser(@Param("uid")String uid);

	//更改用户密码
	void updateUserPassword(@Param("uid")String uid,@Param("password")String password);

	String selectUserPassword(@Param("uid")String uid);



}
